#!/usr/bin/env python
# -*- coding: UTF-8 -*-



my_dict = {}
my_dict['jj_code'] = 'code'
my_dict['ly'] = 'hx'
my_dict['l123y'] = 'hx111'
cols = ', '.join(my_dict.keys())
values = '","'.join(my_dict.values())



# print(cols)
table = 'jj_history'
# sql = "replace into %s (%s) values (%s)" % (table, cols, '"' + values + '"') 

cv = ''
for (k,v) in my_dict.items():
    if cv == '':
        cv += k + ' = "' + v + '"'
    else:
        cv += ', ' + k + ' = "' + v + '"'

print(cv)
tid = '23456'
sql = "update %s set %s where id = %s" % (table, cv, '"' + tid + '"') 
print(sql)

# update jj_history set ypck = '' where id = ''
# print(sql)